include ../../Makehead

LdFlags += -r
CFlags += -I../../include -finline-functions
CPP += -I../../include

.c.s:
	$(CC) $(CFlags) -S -o $*.s $<
.s.o:
	$(AS) -o $*.o $<
.c.o:
	$(CC) $(CFlags) -c -o $*.o $<

OBJS = console.o tty_io.o keyboard.o serial.o pty.o rs_io.o tty_ioctl.o \
		lp.o 

build: chr_drv.a 

chr_drv.a: $(OBJS)
	@$(AR) rcs chr_drv.a $(OBJS)
	@sync 

keyboard.s: keyboard.S 
	$(CPP) -o $@ $<

rs_io.s: rs_io.S 
	$(CPP) -o $@ $< 
	
clean:
	rm -rf *.o *.s chr_drv.a 